# !/usr/bin/env python 
# -*- coding:utf-8 -*-
# @Author: happy 
# @Date: 2018-09-06 10:16:52 
# @Last Modified by:   happy 
# @Last Modified time: 2018-09-06 10:16:52 
# @Desc: 

import numpy as np
import matplotlib.pyplot as plt



# 17 * x ^ 2 - 16 * |x| * y + 17 * y ^ 2 = 225
X = np.arange(-5.0, 5.0, 0.1)
Y = np.arange(-5.0, 5.0, 0.1)

x, y = np.meshgrid(X, Y)
f = 17 * x ** 2 - 16 * np.abs(x) * y + 17 * y ** 2 - 225

fig = plt.figure()

cs = plt.contour(x, y, f, 0, colors='r')
# plt.show()


# 8*x^2 - 9*|x|*y + 8*y^2 = 17
X = np.arange(-2.0, 2.0, 0.05)
Y = np.arange(-2.0, 2.0, 0.05)

x, y = np.meshgrid(X, Y)
f = 8 * x ** 2 - 9 * np.abs(x) * y + 8 * y ** 2 - 17
fig = plt.figure()
cs = plt.contour(x, y, f, 0, color='b')
plt.show()